// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
	//上传头像
	let uploadAvatar = (params = {}) => vm.$u.post('/api/v1/user/avatarUrl', params);
	// 登录
	let login = (params = {}) => vm.$u.get('/api/v1/user/oauthMiniUser', params);
	// 手机号注册
	let getUserMobile = (params = {}) => vm.$u.post('/api/v1/user/getUserMobile', params);
	// 用户信息
	let getUserInfo = (params = {}) => vm.$u.post('/api/v1/user/getUserinformation', params);
	// 修改用户信息
	let editUserInfo = (params = {}) => vm.$u.post('/api/v1/User/editInfo', params);
	// 轮播图
	let getBanner = (params = {}) => vm.$u.post('/api/v1/banner/index', params);
	// 军师
	let getJunshiTeamList = (params = {}) => vm.$u.post('/api/v1/team/teamLst', params);
	// 军师详情
	let getJunshiDetail = (params = {}) => vm.$u.post('/api/v1/team/teamDetail', params);
	//文章详情
	let getArticleDetail = (params = {}) => vm.$u.get('/api/v1/Article/ArticleDetail', params);
	// 经典案例
	let getCase = (params = {}) => vm.$u.post('/api/v1/classic_cases/CasesLst', params);
	// 经典案例详情
	let getCaseDetail = (params = {}) => vm.$u.post('/api/v1/classic_cases/CasesDetail', params);
	// 分享案例
	let getShareList = (params = {}) => vm.$u.post('/api/v1/experience_sharing/SharingLst', params);
	// 分享案例详情
	let getShareDetail = (params = {}) => vm.$u.post('/api/v1/experience_sharing/SharingDetail', params);
	// 主题讲座
	let getLectureList = (params = {}) => vm.$u.post('/api/v1/theme_lecture/lectureLst', params);
	// 主题讲座详情
	let getLectureDetail = (params = {}) => vm.$u.post('/api/v1/theme_lecture/lectureDetail', params);
	// 专属解析
	let getAnalysisList = (params = {}) => vm.$u.post('/api/v1/analysis/analysisLst', params);
	// 专属解析详情
	let getAnalysisDetail = (params = {}) => vm.$u.post('/api/v1/analysis/analysisDetail', params);
	// 最新文章
	let getArticleList = (params = {}) => vm.$u.post('/api/v1/Article/ArticleLst', params);
	// 课程类列表
	let getClassTabber = (params = {}) => vm.$u.post('/api/v1/Courseclassification/Lst', params);
	// 课程列表 // 热门课程
	let getClassList = (params = {}) => vm.$u.post('/api/v1/Product/ProductLst', params);
	// 课程详情
	let getClassDetail = (params = {}) => vm.$u.post('/api/v1/Product/ProductDetails', params);
	// 提交订单
	let submitOrder = (params = {}) => vm.$u.post('/api/v1/product_order/createOrder', params);
	// 购买
	let pay = (params = {}) => vm.$u.post('/api/v1/product_order/pay', params);
	// 首页
	// 新闻动态
	let JournalismList = (params = {}) => vm.$u.post('/api/v1/journalism/JournalismLst', params);
	// 新闻咨询详情
	let JournalismDetail = (params = {}) => vm.$u.post('/api/v1/Journalism/JournalismDetails', params);
	// 品牌故事
	let BrandstoryList = (params = {}) => vm.$u.post('/api/v1/brandstory/BrandstoryLst', params);
	let BrandstoryInfo = (params = {}) => vm.$u.post('/api/v1/Brandstory/BrandstoryDetails', params);
	// 观看记录
	let ProductRecord = (params = {}) => vm.$u.post('/api/v1/Product/ProductRecord', params);
	// 收藏
	let collect = (params = {}) => vm.$u.post('/api/v1/Product/Collection', params);
	// 我的
	// 我的课程
	// 课程分类
	let myClassesTypeList = (params = {}) => vm.$u.post('/api/v1/Courseclassification/Lst', params);
	// 课程列表
	let myClassesList = (params = {}) => vm.$u.post('/api/v1/Product/UserProductLst', params);
	// w我的收藏
	// 收藏列表
	let collectList = (params = {}) => vm.$u.post('/api/v1/Product/UserCollectionLst', params);
	// 收藏分类
	let collectTypeList = (params = {}) => vm.$u.post('/api/v1/Product/CollectionTypeLst', params);
	// 签到
	// 签到页面数据
	let getSignInData = (params = {}) => vm.$u.post('/api/v1/Signin/index', params);
	// 立即签到
	let signInNow = (params = {}) => vm.$u.post('/api/v1/Signin/dosign', params);
	// 补签
	let fillSignIn = (params = {}) => vm.$u.post('/api/v1/Signin/fillup', params);
	// 我的兑换券
	let myDuihuanquan = (params = {}) => vm.$u.post('/api/v1/User/getUserScore', params);
	// 关于我们
	let getAbout = (params = {}) => vm.$u.post('/api/v1/About/about', params);
	// 活动
	let getActivity = (params = {}) => vm.$u.post('/api/v1/Config/configActivity', params);
	
	// 直播回访详情
	let getLivebackInfo = (params = {}) => vm.$u.post('/api/v1/Liveplayback/LiveplaybackDetail', params);
	// 组长团队
	let getGroupList = (params = {}) => vm.$u.post('/api/v1/Groupleader/GroupleaderLst', params);
	// 组装团队详情
	let getGroupinfo = (params = {}) => vm.$u.post('/api/v1/Groupleader/GroupleaderDetail', params);
	// 组长音频
	let groupAudioList = (params = {}) => vm.$u.post('/api/v1/Groupleader/GroupleaderAudioDetail', params);
	// 加油站
	// 列表
	let CultivateLst = (params = {}) => vm.$u.post('/api/v1/Cultivate/CultivateLst', params);
	// 问题列表
	let QuestionLst = (params = {}) => vm.$u.post('/api/v1/Question/QuestionLst', params);
	// 加油站分类
	let CultivateTypeLst = (params = {}) => vm.$u.post('/api/v1/Cultivateclassification/Lst', params);
	// 问题分类
	let QuestionTypeLst = (params = {}) => vm.$u.post('/api/v1/Question/QtypeList', params);
	// 详情
	let AnalysisDetail = (params = {}) => vm.$u.post('/api/v1/Analysis/AnalysisDetail', params);
	let CultivateDetail = (params = {}) => vm.$u.post('/api/v1/Cultivate/CultivateDetail', params);
	// 问题详情
	let QuestionDetail = (params = {}) => vm.$u.post('/api/v1/Question/QuestionDetail', params);
	// 检查打开问题次数
	let CheckQuestionNum = (params = {}) => vm.$u.post('/api/v1/Question/CheckQuestionNum', params);
	// 客服
	// 列表
	let getChatList = (params = {}) => vm.$u.post('/api/v1/Customerservice/CustomerserviceLst', params);
	// 配置
	let getChatConfig = (params = {}) => vm.$u.post('/api/v1/Customerservice/CustomerserviceConfig', params);
	// 咨询客服
	let customerSerivce = (params = {}) => vm.$u.post('/api/v1/Customerservice/ConsultCustomerservice', params);
	// 经典案例客服
	let caseService = (params = {}) => vm.$u.post('/api/v1/Customerservice/CaseCustomerservice', params);
	// 课程客服
	let classService = (params = {}) => vm.$u.post('/api/v1/Customerservice/CurriculumCustomerservice', params);
	// 活动客服
	let activityService = (params = {}) => vm.$u.post('/api/v1/Customerservice/CurriculumActivityservice', params);
	// 排名
	let getPaiming = (params = {}) => vm.$u.post('/api/v1/Product/UniversalLeaderboard', params);
	// 配置接口-主页=》微课
	let getWeikeId = (params = {}) => vm.$u.post('/api/v1/Config/configList', params);
	// 反馈资源
	// 列表
	let getResourcesList = (params = {}) => vm.$u.post('/api/v1/Resources/ResourcesLst', params);
	// 详情
	let getResourcesDetail = (params = {}) => vm.$u.post('/api/v1/Resources/ResourcesDetail', params);
	// 反馈
	let resources = (params = {}) => vm.$u.post('/api/v1/Resources/FeedbackResources', params);
	// 兑换会员期
	let exchange = (params = {}) => vm.$u.post('/api/v1/Exchange/exchange', params);
	// 学习记录
	let getStudyOrder = (params = {}) => vm.$u.post('/api/v1/Product/UserRecord', params);
	// 更换头像
	let changeAvatar = (params = {}) => vm.$u.post('/api/v1/User/upload', params);
	// 更换手机号
	let changeMobile = (params = {}) => vm.$u.post('/api/v1/User/changemobile', params);
	// 绑定手机号
	let bandingMobile = (params = {}) => vm.$u.post('/api/v1/User/bindmobile', params);
	// 获取验证码
	let getCaptcha = (params = {}) => vm.$u.post('/api/sms/send', params);
	// 验证手机号是否可用
	let Checkmobile = (params = {}) => vm.$u.post('/api/v1/User/Checkmobile', params);
	// 消息订阅配置
	let message = (params = {}) => vm.$u.post('/api/v1/Product/Wxtemplate', params);
	// 订阅
	let subscribe = (params = {}) => vm.$u.post('/api/v1/Product/Subscribe', params);
	// 获取订阅状态
	let messageStatu = (params = {}) => vm.$u.post('/api/v1/Product/isSubscribe', params);
	//获取用户列表
	let userList = (params = {}) => vm.$u.post('/api/v1/User/getUserLst', params);
	let getAdList = (params = {}) => vm.$u.post('/api/v1/Ad/getAdList', params);
	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		getAnalysisList,
		getAnalysisDetail,
		uploadAvatar,
		userList,
		messageStatu,
		subscribe,
		message,
		Checkmobile,
		classService,
		activityService,
		bandingMobile,
		changeMobile,
		getCaptcha,
		editUserInfo,
		customerSerivce,
		caseService,
		getStudyOrder,
		getWeikeId,
		resources,
		exchange,
		getResourcesDetail,
		getResourcesList,
		JournalismDetail,
		groupAudioList,
		getPaiming,
		getChatConfig,
		getChatList,
		CultivateDetail,
		AnalysisDetail,
		CultivateTypeLst,
		CultivateLst,
		// getLivebackList,
		getAdList,
		getLivebackInfo,
		getGroupList,
		getGroupinfo,
		myClassesTypeList,
		myClassesList,
		collectList,
		collectTypeList,
		getSignInData,
		signInNow,
		fillSignIn,
		myDuihuanquan,
		getAbout,
		getActivity,
		login,
		getUserMobile,
		getUserInfo,
		getBanner,
		getJunshiTeamList,
		getJunshiDetail,
		getArticleDetail,
		getCase,
		getCaseDetail,
		getShareList,
		getShareDetail,
		getLectureList,
		getLectureDetail,
		getArticleList,
		getClassTabber,
		getClassList,
		getClassDetail,
		submitOrder,
		pay,
		JournalismList,
		BrandstoryList,
		BrandstoryInfo,
		ProductRecord,
		collect,
		QuestionLst,QuestionTypeLst,QuestionDetail,CheckQuestionNum
	}
}

export default {
	install
}
